package com.googlecode.controlecheque.database;

import java.io.Serializable;
import java.util.Date;

import android.net.Uri;
import android.provider.BaseColumns;

public class Cheque implements BaseColumns, Serializable {

	private static final long serialVersionUID = -3777885816043446727L;

	public static final String TABLE_NAME = "cheque";
	public static final String AUTHORITY = "com.googlecode.controlecheque.database";
	public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/" + TABLE_NAME);

	public static final String CONTENT_TYPE = "vnd.android.cursor.dir/vnd.controlecheque.cheque";
	public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/vnd.controlecheque.cheque";

	public static final String DEFAULT_SORT_ORDER = "nr_agencia DESC";

	public static final String BANCO = "id_banco";
	public static final String AGENCIA = "nr_agencia";
	public static final String CONTA = "nr_conta";
	public static final String NUMERO_CHEQUE = "nr_cheque";
	public static final String VALOR = "valor";
	public static final String DATA_EMISSAO = "dt_emissao";
	public static final String DATA_VENCIMENTO = "dt_vencimento";
	public static final String CORRENTISTA = "correntista";
	public static final String CLIENTE = "id_cliente";
	public static final String SITUACAO = "id_situacao";

	public Integer idCheque;
	public String idBanco;
	public String cdBanco;
	public String nmBanco;
	public Integer nrAgencia;
	public String nrConta;
	public String nrCheque;
	public Double valor;
	public Date dtEmissao;
	public Date dtVencimento;
	public String correntista;
	public String nmCliente;
	public Integer situacao;

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((idCheque == null) ? 0 : idCheque.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (!(obj instanceof Cheque))
			return false;
		Cheque other = (Cheque) obj;
		if (idCheque == null) {
			if (other.idCheque != null)
				return false;
		} else if (!idCheque.equals(other.idCheque))
			return false;
		return true;
	}
}
